package com.example.demo.mongodb.service.impl;

import com.example.demo.entiy.Message;
import com.example.demo.mongodb.repository.MessageRepository;
import com.example.demo.mongodb.service.MessageService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class MessageServiceImpl implements MessageService {

    @Resource
    private MessageRepository messageRepository;

    @Override
    public void insert(Message message) {
        messageRepository.insert(message);
    }

    @Override
    public Message findById(Long id) {
        return messageRepository.findById(id);
    }


}
